﻿<?php
	function withJS()
	{
	$query = "SELECT * FROM ucat" ;
	$counter1 = mysql_query("SELECT COUNT(*) as c FROM ucat");
	$c = mysql_fetch_array($counter1);
	$result=mysql_query($query);	
  echo 'document.write(\'<select name="kategoria" class="styled" size="8" onChange="fill(this.options.selectedIndex);" > \')';
			//tworzenie select - kategoria
			$count = 0;       
      while ($r=mysql_fetch_array($result))
      {
          echo 'document.write(\'<option>'.$r['name'].'</option> \')
							';
			}
      echo      'document.write(\'</select> </td>'
              . '</tr>
								<tr><td>Podkategoria</td>'
              . '<td><select name="podkategoria" class="styled" size="1" >'
							. '<option>Wybierz kategoriÄ</option>'
              . '</select>  \')';
	}
							
?>